<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "article".
 *
 * @property integer $article_id
 * @property integer $article_class_id
 * @property string $title
 * @property string $content
 * @property string $excerpt
 * @property string $author
 * @property string $keywords
 * @property string $source
 * @property integer $is_show
 * @property integer $sort
 * @property integer $create_time
 */
class Article extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'article';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['article_class_id', 'is_show', 'sort', 'create_time'], 'integer'],
            [['title', 'content', 'create_time'], 'required'],
            [['content', 'excerpt'], 'string'],
            [['title', 'keywords', 'source'], 'string', 'max' => 255],
            [['author'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'article_id' => '文章ID',
            'article_class_id' => '分类ID',
            'title' => '标题',
            'content' => '内容',
            'excerpt' => '摘要',
            'author' => '发表者',
            'keywords' => '关键词',
            'source' => '转载文章的来源',
            'is_show' => '是否显示',
            'sort' => '排序',
            'create_time' => '创建时间',
        ];
    }
}
